export default function commonMethods() {
  // 表单验证失败，跳转到错误表单信息行
  const gotoErrorItem = (errorList:any, formRef:any) => {
    Object.keys(errorList).forEach((key, i) => {
      const propName = errorList[key][0].field;
      if (i == 0) {
        formRef.scrollToField(propName);
      }
    });
  };
  return { gotoErrorItem };
}